package com.xzl.time.mapper;

import com.xzl.time.pojo.Notice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @describe ：消息
 * @PageLocation:
 * @Auther xzl
 * @Date 2022/1/7 15:33
 */
@Mapper
public interface NoticeMapper {
    //新增消息
    int insert(@Param("notice") Notice notice);
    //用过发送的用户、接受的用户、对象id删除消息
    int delNoticeById(@Param("notice") Notice notice);
    //通过用户查询消息
    int selNoticeByUserId(@Param("userId") String userId);
    //通过消息类型和当前用户查询消息
    List<Notice> getNoticeByTypeAndReceiverId(String targetType, String receiverId);
    //通过消息id修改消息状态（是否已查看
    int updNoticeState(@Param("noticeIds") List<String> noticeIds);
    //通过消息类型和当前用户获取消息 内容
    List<Notice> getCommentNoticeByTypeAndReceiverId(String targetType, String receiverId);
}
